home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_559 / apig / apiglib_v11.lzh / e9_layers.rexx < prev    next >
OS/2 REXX Batch file  |  1991-09-28  |  3KB  |  139 lines

  1. /* example using Layer functions */
  2.  
  3. /*  */
  4.  x = addlib("apig.library",0,-30,0)
  5.  
  6.  portname = "example9_port"
  7.  p = openport(portname)
  8.  
  9.  call set_apig_globals()         /* Create Intuition Global Constants */
  10.  
  11.  wintitle = "This is your title"
  12.  winidcmp = CLOSEWINDOW+GADGETDOWN+GADGETUP+REFRESHWINDOW
  13.  winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO+SMART_REFRESH+ACTIVATE
  14.  
  15.  /* open window */
  16.  w1   = openwindow(portname,0,0,640,400,2,4,winidcmp,winflags,wintitle,0,1,0,0) 
  17.  rpw1 = getwindowrastport(w1)
  18.  
  19.  w3   = openwindow(portname,100,200,240,100,2,4,winidcmp,winflags,"Window Three",0,0,0,0) 
  20.  rpw3 = getwindowrastport(w3)
  21.  
  22.  w2   = openwindow(portname,100,100,440,250,2,4,winidcmp,winflags,"Window Two",0,1,0,0) 
  23.  rpw2 = getwindowrastport(w2)
  24.  
  25.  
  26.  lay  = createupfrontlayer(w1,50,50,300,180,LAYERSMART,0)
  27.  lrp  = getlayerrastport(lay)
  28.  
  29.  lay2 = createbehindlayer(w1,150,100,300,180,LAYERSMART,0)
  30.  lrp2 = getlayerrastport(lay2)
  31.  
  32.  x = setrast(lrp,3)
  33.  x = setrast(lrp2,7)
  34.  x = setapen(lrp2,4)
  35.  x = setbpen(lrp2,3)
  36.  x = setdrmd(lrp2,JAM2)
  37.  x = move(lrp2,0,15)
  38.  x = text(lrp2," this is a layer ",-1)
  39.  
  40.  x = setapen(lrp,1)
  41.  x = rectfill(lrp,20,20,120,80)
  42.  
  43.  wait 2 secs
  44.  
  45.  z = movelayerinfrontof(lay2,lay)
  46.  
  47.  wait 2 secs
  48.  
  49.  x = movelayer(lay,230,40)
  50.  
  51.  x = move(lrp,0,10)
  52.  x = setdrmd(lrp,JAM1)
  53.  x = setapen(lrp,5)
  54.  x = text(lrp,"hey this is a layer too ",-1)
  55.  
  56.  x = move(lrp,5,28)
  57.  x = text(lrp,"this box is ",-1)
  58.  x = move(lrp,5,45)
  59.  x = text(lrp,"just a rectfill",-1)
  60.  
  61.  z = refreshwindowframe(w2)
  62.  
  63.  wait 3 sec
  64.  do i = 1 to 24
  65.     if i < 11 then
  66.        x = writeconsole(w1,"this is a test=" i || '0a'x)
  67.     x = writeconsole(w2,"okay buddy what are you doing with this program." || '0a'x)
  68.  end
  69.  
  70.  x = movelayer(lay,-230,0)
  71.  wait 2 sec 
  72.  x = movelayer(lay,180,0)
  73.   
  74. z = refreshwindowframe(w2)
  75.  
  76.   
  77. wait 1 sec
  78. z = behindlayer(lay)
  79.  
  80. wait 2 secs
  81. z = upfrontlayer(lay)
  82.  
  83. wait 2 secs
  84. z = sizelayer(lay,90,120)
  85. z = move(lrp,10,150)
  86. z = text(lrp,"hey buddy see this layer just got bigger ",-1)
  87.  
  88. wait 3 secs
  89. x = movelayer(lay,-180,0)
  90.  
  91. z = upfrontlayer(lay2)
  92. wait 1 secs
  93. z = behindlayer(lay2)
  94. wait 1 secs
  95. z = upfrontlayer(lay2)
  96. wait 1 secs
  97. x = movelayer(lay2,-60,-10)
  98. wait 1 secs
  99. x = movelayer(lay2,-60,-10)
  100.  
  101. z = refreshwindowframe(w2)
  102.  
  103. wait 3 sec
  104. x = deletelayer(lay)
  105. x = deletelayer(lay2)
  106.  
  107. z = refreshwindowframe(w2)
  108.  
  109. exitme = 0
  110. x = writeconsole(w1,"Okay Im Done" || '0a'x)
  111. x = writeconsole(w1,"Okay Im Done" || '0a'x)
  112. x = writeconsole(w2,"Okay Im Done" || '0a'x)
  113. x = writeconsole(w2,"Okay Im Done" || '0a'x)
  114. do forever
  115.  
  116.      x = waitpkt(portname)
  117.   
  118.      do forever 
  119.   
  120.         msg = '0000 0000'x
  121.         msg = getpkt(portname)
  122.         if msg = '0000 0000'x then leave
  123.         class = getarg(msg,0)
  124.         if class = CLOSEWINDOW then exitme = 1
  125.         
  126.         x = reply(msg,0)  
  127.      end  
  128.    if exitme = 1 then leave
  129.    
  130. end
  131.  
  132.   a =closewindow(w2) 
  133.   a =closewindow(w3) 
  134.   a =closewindow(w1)
  135.   a =closescreen(scr)
  136.  
  137.   exit
  138.  
  139.